var  path = require("path");
var htmlWebpackPlugin = require("html-webpack-plugin");
const { VueLoaderPlugin } = require('vue-loader');

module.exports = {
    entry: path.join(__dirname, './src/main.js'),
    output:{
        path:path.resolve(__dirname,"../BookMarkey_Node/public"),
        // path:"/Users/baipu/study/BookMarkey_Node/publish123",    
        filename:'boundle.js'
    },
    plugins: [
        new htmlWebpackPlugin({
            template: path.resolve(__dirname, './src/index.html'),
            filename:"index.html"//自动生成的html文件的名称
        }),
        new VueLoaderPlugin()
    ],
    module: {
        rules: [
            { test: /\.css$/, use: ['style-loader', 'css-loader'] },
            // { test: /\.(woff|woff2)$/, loader: "url?prefix=font/&limit=5000" },
            {
                test: /\.(woff|woff2|eot|ttf|otf)$/,
                use: ['file-loader' ]
            },
            // { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" },
            // { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" },
            {
                test: /\.svg/,
                use: ['file-loader']
            },
            { test: /\.vue$/, use: 'vue-loader' }
        ]
    },
    resolve: {
        alias: {
            "vue$":"vue/dist/vue.js"
        }
    },
    devtool: '#source-map'
};